<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>


<body>

   <div>年份：<span class="year"></span></div>
   <div>宜：<span class="avoid"></span></div>
   <div>忌：<span class="suit"></span></div>

    <script>
        // 模拟网络请求
        let json = {
            "reason": "Success",
            "result": {
                "data": {
                    "animalsYear": "蛇",
                    "weekday": "星期二",
                    "lunarYear": "乙巳",
                    "lunar": "九月十五",
                    "year-month": "2025-11",
                    "date": "2025-11-4",
                    "avoid": "结婚.开业",
                    "desc": "",
                    "holiday": "",
                    "suit": "祭祀.馀事勿取.铺路"
                }
            },
            "error_code": 0
        }
        // 获取对象中某一个属性值的时候可以通过 对象[‘对象名’]
     document.querySelector('.year').innerHTML = json.result.data['year-month']
     document.querySelector('.avoid').innerHTML = json.result.data['avoid']
     document.querySelector('.suit').innerHTML = json.result.data['suit']

        

    </script>
</body>

</html>